/*
 * Graphics.h
 *
 *  Created on: 08/01/2012
 *      Author: Mariano
 */

#ifndef GRAPHICS_H_
#define GRAPHICS_H_
#include <list>
#include "../events/KeyListener.h"
#include "../game/Camera.h"
#include "SpriteInstance.h"
#include "Common.h"

class Graphics: public KeyListener {
public:
	Graphics(int w, int h);
	virtual ~Graphics();
	bool update(int delay);
	void quit();
	void setBackgroundColor(Uint32 color);

	void addSpriteInstance(SpriteInstance * sprite);

	void onKeyDown(SDL_Event * event);
	void onKeyUp(SDL_Event * event);

	Camera * getCamera();

private:

	void drawSprite(SpriteInstance * sprite);

	bool running;
	SDL_Surface * screen;
	std::list<SpriteInstance *> spriteList;
	Uint32 backgroundColor;
	Camera cam;
};

#endif /* GRAPHICS_H_ */
